define(
    function (require) {
        require('tpl!./form.tpl.html');

        var util = require('common/util');

        var BaseFormView = require('common/FormView');

        function SurpriseShopFormView() {
            BaseFormView.apply(this, arguments);
        }

        SurpriseShopFormView.prototype.template = 'surpriseShopForm';

        SurpriseShopFormView.prototype.enterDocument = function() {
            BaseFormView.prototype.enterDocument.apply(this, arguments);
        };

        /**
         * 从表单中获取实体数据
         *
         * @return {Object}
         */
        SurpriseShopFormView.prototype.getEntity = function () {
            var entity = BaseFormView.prototype.getEntity.apply(this, arguments);
            entity = util.omit(entity, 'files');
            if (util.isString(entity.mallid)) {
                entity.mallid = entity.mallid.replace(/^\w+?_/, '');
            }
            return entity;
        };

        /**
        function getAreaCode() {
            var cityControl = this.get('city');
            var cityValue = cityControl.getValue();
            var city = util.findWhere(
                this.model.get('cityList'),
                {
                    value: parseInt(cityValue, 10)
                }
            );
            return city.areaCode || '021';
        }
        */

        require('er/util').inherits(SurpriseShopFormView, BaseFormView);
        return SurpriseShopFormView;
    }
);
